Overview

The Dundas BI engine provides methods for accessing core application functionality. The engine can be started, stopped, and provides a means of getting the different Dundas BI service interfaces. This page outlines creating, and starting the Dundas BI Engine. Also, it gives an example of the logon functionality.

Create the Engine

In order to create the Dundas BI Engine you need to create a CreateEngineOptions object:

Optionally, the following other options can be set when creating an engine:

using Dundas.BI;
using Dundas.BI.Services;
   ...

// Create the CreateEngineOptions object.
CreateEngineOptions createEngineOptions = new CreateEngineOptions();
// Path to the application's data folder. Type: System.String
createEngineOptions.AppDataPath = appDataPath;

// Create the Engine.
EngineManager.CreateEngine(createEngineOptions);
    

Start the Engine

To start the engine use the StartEngine method on the EngineManager class.

using Dundas.BI;
using Dundas.BI.Services;
   ...

EngineManager.StartEngine();
    

Logon

After starting the engine it is necessary to set the current caller context to null. Next, logon and then set the current caller context to the session ID from the logonresult object.

using Dundas.BI;
using Dundas.BI.Services;
   ...

Engine.Current.GetService<ICallerContextService>().CreateAndSetCurrentContext(null);
		
LogOnResult logOnResult = Engine.Current.GetService<ILogOnService>().LogOn(
	"admin",
	"1234",
	true,
	null
);
		
Engine.Current.GetService<ICallerContextService>().CurrentContext.SetCurrentSessionId(
	logOnResult.Session.Id
);
    

Example

The following example creates, and starts the Dundas BI Engine, logs on, and sets the caller context:

using Dundas.BI;
using Dundas.BI.Services;
   ...

 // Create the CreateEngineOptions object.
CreateEngineOptions createEngineOptions = new CreateEngineOptions();
// Path to the application's data folder. Type: System.String
createEngineOptions.AppDataPath = appDataPath;
// Create the Engine.
EngineManager.CreateEngine(createEngineOptions);
EngineManager.StartEngine();
 
Engine.Current.GetService<ICallerContextService>().CreateAndSetCurrentContext(null);
 
LogOnResult logOnResult = Engine.Current.GetService<ILogOnService>().LogOn(
    // The account name. Type: System.String
    accountName,
    // The password. Type: System.String
    password,
    // Delete other sessions for the logon to succeed. Type: System.Boolean
    deleteOtherSessions,
    // Culture to associate with the session, or null. Type: System.Globalization.CultureInfo
    explicitCulture
);
 
Engine.Current.GetService<ICallerContextService>().CurrentContext.SetCurrentSessionId(
    logOnResult.Session.Id
);